package com.stockz.indicator;

import java.util.List;

import com.stockz.core.model.Bar;
import com.stockz.core.util.BarUtil.BarValueType;

public interface Indicator<T> {
	
	/*
	 * Indicator configuration can be any POJO 
	 * and doesn't need to implement or extend anything
	 * Object returned by this method can not be null
	 * Object returned should be singleton
	 * As all the configuration is to be set using setters 
	 * in the configuration object, there is no need for any
	 * setter for the configuration object itself
	 */
	public T getIndicatorConfiguration();
	
	public BarValueType getBarValueType();
	public void setBarValueType(BarValueType barValueType);

	/*
	 * Should return an array of double having length exactly equal
	 * to the size of list passed.
	 * Calculates indicator values for each bar
	*/
	public double[] getValues(List<Bar> barList);
	
	/*
	 * Returns the indicator value for 0th element of the list passed
	*/
	public double getValue(List<Bar> barList);
	
}
